package cn.com.bluemoon.daps.model.mapper;

import cn.com.bluemoon.daps.model.dto.DapModelHistoryDto;
import cn.com.bluemoon.daps.model.dto.score.TableScoreDto;
import cn.com.bluemoon.daps.model.entity.DapDataModelOperateHistory;
import cn.com.bluemoon.daps.model.vo.SearchModelHistoryVo;
import cn.com.bluemoon.daps.model.vo.SearchRecordTableVo;
import cn.com.bluemoon.daps.model.vo.score.SearchTableScoreVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 申请发布版本记录表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2020-08-03
 */
@Repository
public interface DapDataModelOperateHistoryMapper extends BaseMapper<DapDataModelOperateHistory> {

    Page<DapDataModelOperateHistory> selectTableHistory(Page page, @Param("vo") SearchRecordTableVo vo);

    @Update("update dap_data_model_operate_history set data_model_record_id = #{recordId} where model_id = #{modelId} and bm_status=1 and public_time is null")
    void updateRecordId(@Param("recordId") String recordId, @Param("modelId") String modelId);

    IPage<DapModelHistoryDto> selectModelHistoryList(Page page, @Param("vo") SearchModelHistoryVo vo);
}
